package collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class SortPoint {
    public static void main(String[] args) {
    List<Point> list = new ArrayList<>();
        list.add(new Point(44,88));
        list.add(new Point(11,22));
        list.add(new Point(66,55));
        list.add(new Point(22,44));
        list.add(new Point(77,77));
        list.add(new Point(55,33));
        list.add(new Point(33,66));
        Collections.sort(list,(o1 , o2) -> o1.getY() - o2.getY());
        System.out.println(list);
    }
}
